<script type="text/javascript">
<!--
$(document).ready(function(){
    $('.hover').popover({
    	html: true
    })
});
//-->
</script>
<div class="content_wrapper">
    <legend>Danh sách tin tức</legend>
    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered table-condensed" id="example" width="100%">
        <thead>
            <tr>
                <th width="25" style="text-align: center;">ID</th>
                <th>Tiêu đề tin tức</th>
                <th>Danh mục</th>
                <th width="70" style="text-align: center;">Tùy chọn</th>
            </tr>
        </thead>
        <tbody>
            <?php if (count($result) > 0):?>
            <?php foreach($result as $key => $value) :?>
             <tr>
                <td><?php echo $value->news_id;?></td>
                <td><?php echo $value->title;?></td>
               <td><?php echo $category[$value->category_id];?></td>
                <td style="text-align: center;">
                    <i title="Kích hoạt" _id_key="news_id" _id_value="<?php echo $value->news_id;?>" _field_key="active_flag" _field_value="<?php echo $value->active_flag;?>" _table="<?php echo TBL_NEWS;?>" _icon_active="icon-ok" _icon_unactive="icon-ban-circle" class="btn_active <?php echo ($value->active_flag == 1) ? 'icon-ok' : 'icon-ban-circle'; ?>"></i>
                    <i title="Nổi bật" _id_key="news_id" _id_value="<?php echo $value->news_id;?>" _field_key="hot_flag" _field_value="<?php echo $value->hot_flag;?>" _table="<?php echo TBL_NEWS;?>" _icon_active="icon-ok" _icon_unactive="icon-ban-circle" class="btn_active <?php echo ($value->hot_flag == 1) ? 'icon-ok' : 'icon-ban-circle'; ?>"></i>
                    <a href="<?php echo base_url('admin/news/edit/'.$value->news_id);?>"><i class="icon-edit"></i></a>
                    <a href="javascript: void(0);" _id="<?php echo $value->news_id;?>" class="del"><i class="icon-remove"></i></a>
                </td>
            </tr>
            <?php endforeach;?>
            <?php else:?>
            <tr><td colspan="10">Chưa có dữ liệu sản phẩm</td></tr>
            <?php endif;?>
        </tbody>
    </table>
</div>
